-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: support Dameng database #3672
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI failed. Please check the error detail in https://github.com/seata/seata/pull/3672/checks
import java.util.List; | ||
|
||
/** | ||
* The type oracle delete recognizer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type dm delete recognizer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please create the sql script in /script/client/at/db/dm.sql
代码已重新提交并优化。 |
方便给我私发一下你的钉钉号吗?我邮箱364176773@qq.com |
rm-datasource/src/main/java/io/seata/rm/datasource/undo/dm/DmUndoDeleteExecutor.java
Outdated
Show resolved
Hide resolved
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #3672 +/- ##
=============================================
+ Coverage 48.02% 48.89% +0.86%
- Complexity 4119 4157 +38
=============================================
Files 761 777 +16
Lines 26853 27944 +1091
Branches 3350 3412 +62
=============================================
+ Hits 12897 13662 +765
- Misses 12540 12858 +318
- Partials 1416 1424 +8
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a bug. only the unique index and all the unique index's columes same as primary key columes,it belongs to primary key it's something like this PR #4005
import io.seata.rm.datasource.sql.struct.TableMeta; | ||
import io.seata.sqlparser.util.JdbcConstants; | ||
|
||
import java.sql.Connection; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
@iquanzhan 请问下,支持DM这个pr, 你们有用在生产跑了吗? |
10:27:11.956 INFO --- [ RetryRollbacking_1_1] [server.coordinator.DefaultCore] [ doGlobalRollback] [192.168.2.50:8091:7800661551294558767] : Rollback global transaction successfully, xid = 192.168.2.50:8091:7800661551294558767.
10:29:09.177 INFO --- [ batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [ run] [] : receive msg[single]: GlobalBeginRequest{transactionName='save(com.beichuanghui.bch.base.vo.save.user.BaseEmployeeSaveVO)', timeout=60000}, clientIp: 192.168.2.168, vgroup: default_tx_group
10:29:09.179 INFO --- [verHandlerThread_1_49_500] [coordinator.DefaultCoordinator] [ doGlobalBegin] [192.168.2.50:8091:7800661551294558907] : Begin new global transaction applicationId: beichuanghui-base-server,transactionServiceGroup: default_tx_group, transactionName: save(com.beichuanghui.bch.base.vo.save.user.BaseEmployeeSaveVO),timeout:60000,xid:192.168.2.50:8091:7800661551294558907
10:29:09.183 INFO --- [ batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [ run] [] : result msg[single]: GlobalBeginResponse{xid='192.168.2.50:8091:7800661551294558907', extraData='null', resultCode=Success, msg='null'}, clientIp: 192.168.2.168, vgroup: default_tx_group
10:29:09.289 INFO --- [ batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [ run] [] : receive msg[merged]: BranchRegisterRequest{xid='192.168.2.50:8091:7800661551294558907', branchType=AT, resourceId='jdbc:dm://192.168.2.30:5236/beichuanghui_ds_c_defaults', lockKey='def_user:397953020899360832;def_user_tenant_rel:397953020899360833', applicationData='{"autoCommit":false,"skipCheckLock":true}'}, clientIp: 192.168.2.168, vgroup: default_tx_group
10:29:09.293 INFO --- [nPool.commonPool-worker-3] [erver.coordinator.AbstractCore] [bda$branchRegister$0] [192.168.2.50:8091:7800661551294558907] : Register branch successfully, xid = 192.168.2.50:8091:7800661551294558907, branchId = 7800661551294558909, resourceId = jdbc:dm://192.168.2.30:5236/beichuanghui_ds_c_defaults ,lockKeys = def_user:397953020899360832;def_user_tenant_rel:397953020899360833
10:29:09.296 INFO --- [ batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [ run] [] : result msg[merged]: BranchRegisterResponse{branchId=7800661551294558909, resultCode=Success, msg='null'}, clientIp: 192.168.2.168, vgroup: default_tx_group
10:29:09.370 INFO --- [ batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [ run] [] : receive msg[merged]: BranchRegisterRequest{xid='192.168.2.50:8091:7800661551294558907', branchType=AT, resourceId='jdbc:dm://192.168.2.30:5236/beichuanghui_ds_c_defaults', lockKey='def_user:397953020899360832;undo_log:30;def_user_tenant_rel:397953020899360833', applicationData='{"autoCommit":false,"skipCheckLock":true}'}, clientIp: 192.168.2.168, vgroup: default_tx_group
10:29:09.373 ERROR --- [nPool.commonPool-worker-3] [ption.AbstractExceptionHandler] [eptionHandleTemplate] [192.168.2.50:8091:7800661551294558907] : Catch TransactionException while do RPC, request: BranchRegisterRequest{xid='192.168.2.50:8091:7800661551294558907', branchType=AT, resourceId='jdbc:dm://192.168.2.30:5236/beichuanghui_ds_c_defaults', lockKey='def_user:397953020899360832;undo_log:30;def_user_tenant_rel:397953020899360833', applicationData='{"autoCommit":false,"skipCheckLock":true}'}
==>
io.seata.core.exception.TransactionException: branch register request failed. xid=192.168.2.50:8091:7800661551294558907, msg=违反表[LOCK_TABLE]唯一性约束
at io.seata.server.AbstractTCInboundHandler$4.execute(AbstractTCInboundHandler.java:187) ~[classes!/:1.7.1-SNAPSHOT]
at io.seata.server.AbstractTCInboundHandler$4.execute(AbstractTCInboundHandler.java:179) ~[classes!/:1.7.1-SNAPSHOT]
at io.seata.core.exception.AbstractExceptionHandler.exceptionHandleTemplate(AbstractExceptionHandler.java:131) ~[seata-core-1.7.1-SNAPSHOT.jar:1.7.1-SNAPSHOT]
at io.seata.server.AbstractTCInboundHandler.handle(AbstractTCInboundHandler.java:179) ~[classes!/:1.7.1-SNAPSHOT]
at io.seata.core.protocol.transaction.BranchRegisterRequest.handle(BranchRegisterRequest.java:136) ~[seata-core-1.7.1-SNAPSHOT.jar:1.7.1-SNAPSHOT]
at io.seata.server.coordinator.DefaultCoordinator.onRequest(DefaultCoordinator.java:523) ~[classes!/:1.7.1-SNAPSHOT]
at io.seata.core.rpc.processor.server.ServerOnRequestProcessor.handleRequestsByMergedWarpMessage(ServerOnRequestProcessor.java:288) ~[seata-core-1.7.1-SNAPSHOT.jar:1.7.1-SNAPSHOT]
at io.seata.core.rpc.processor.server.ServerOnRequestProcessor.lambda$onRequestMessage$1(ServerOnRequestProcessor.java:178) ~[seata-core-1.7.1-SNAPSHOT.jar:1.7.1-SNAPSHOT]
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700) ~[na:na]
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692) ~[na:na]
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) ~[na:na]
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) ~[na:na]
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) ~[na:na]
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) ~[na:na]
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) ~[na:na]
Caused by: io.seata.common.exception.StoreException: 违反表[LOCK_TABLE]唯一性约束
at io.seata.server.storage.db.lock.LockStoreDataBaseDAO.acquireLock(LockStoreDataBaseDAO.java:199) ~[classes!/:1.7.1-SNAPSHOT]
at io.seata.server.storage.db.lock.DataBaseLocker.acquireLock(DataBaseLocker.java:64) ~[classes!/:1.7.1-SNAPSHOT]
at io.seata.server.lock.AbstractLockManager.acquireLock(AbstractLockManager.java:65) ~[classes!/:1.7.1-SNAPSHOT]
at io.seata.server.session.BranchSession.lock(BranchSession.java:287) ~[classes!/:1.7.1-SNAPSHOT]
at io.seata.server.transaction.at.ATCore.branchSessionLock(ATCore.java:77) ~[classes!/:1.7.1-SNAPSHOT]
at io.seata.server.coordinator.AbstractCore.lambda$branchRegister$0(AbstractCore.java:83) ~[classes!/:1.7.1-SNAPSHOT]
at io.seata.server.storage.db.session.DataBaseSessionManager.lockAndExecute(DataBaseSessionManager.java:191) ~[classes!/:1.7.1-SNAPSHOT]
at io.seata.server.session.SessionHolder.lockAndExecute(SessionHolder.java:367) ~[classes!/:1.7.1-SNAPSHOT]
at io.seata.server.coordinator.AbstractCore.branchRegister(AbstractCore.java:77) ~[classes!/:1.7.1-SNAPSHOT]
at io.seata.server.coordinator.DefaultCore.branchRegister(DefaultCore.java:103) ~[classes!/:1.7.1-SNAPSHOT]
at io.seata.server.coordinator.DefaultCoordinator.doBranchRegister(DefaultCoordinator.java:294) ~[classes!/:1.7.1-SNAPSHOT]
at io.seata.server.AbstractTCInboundHandler$4.execute(AbstractTCInboundHandler.java:184) ~[classes!/:1.7.1-SNAPSHOT]
... 14 common frames omitted
Caused by: java.sql.BatchUpdateException: 违反表[LOCK_TABLE]唯一性约束
at dm.jdbc.driver.DBError.throwBatchUpdateException(DBError.java:728) ~[DmJdbcDriver18-8.1.2.192.jar:- 8.1.2.192 - Production]
at dm.jdbc.a.a.a(DBAccess.java:910) ~[DmJdbcDriver18-8.1.2.192.jar:- 8.1.2.192 - Production]
at dm.jdbc.driver.DmdbPreparedStatement.do_executeLargeBatch(DmdbPreparedStatement.java:654) ~[DmJdbcDriver18-8.1.2.192.jar:- 8.1.2.192 - Production]
at dm.jdbc.driver.DmdbPreparedStatement.do_executeBatch(DmdbPreparedStatement.java:601) ~[DmJdbcDriver18-8.1.2.192.jar:- 8.1.2.192 - Production]
at dm.jdbc.driver.DmdbPreparedStatement.executeBatch(DmdbPreparedStatement.java:1623) ~[DmJdbcDriver18-8.1.2.192.jar:- 8.1.2.192 - Production]
at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeBatch(DruidPooledPreparedStatement.java:565) ~[druid-1.2.6.jar:1.2.6]
at io.seata.server.storage.db.lock.LockStoreDataBaseDAO.doAcquireLocks(LockStoreDataBaseDAO.java:371) ~[classes!/:1.7.1-SNAPSHOT]
at io.seata.server.storage.db.lock.LockStoreDataBaseDAO.acquireLock(LockStoreDataBaseDAO.java:187) ~[classes!/:1.7.1-SNAPSHOT]
... 25 common frames omitted
<==
10:29:09.376 INFO --- [ batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [ run] [] : result msg[merged]: BranchRegisterResponse{branchId=0, resultCode=Failed, msg='TransactionException[branch register request failed. xid=192.168.2.50:8091:7800661551294558907, msg=违反表[LOCK_TABLE]唯一性约束]'}, clientIp: 192.168.2.168, vgroup: default_tx_group
10:29:09.382 INFO --- [ batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [ run] [] : receive msg[merged]: BranchReportRequest{xid='192.168.2.50:8091:7800661551294558907', branchId=7800661551294558909, resourceId='null', status=PhaseOne_Failed, applicationData='null', branchType=AT}, clientIp: 192.168.2.168, vgroup: default_tx_group
10:29:09.385 INFO --- [nPool.commonPool-worker-3] [erver.coordinator.AbstractCore] [ branchReport] [192.168.2.50:8091:7800661551294558907] : Report branch status successfully, xid = 192.168.2.50:8091:7800661551294558907, branchId = 7800661551294558909
10:29:09.387 INFO --- [ batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [ run] [] : result msg[merged]: BranchReportResponse{resultCode=Success, msg='null'}, clientIp: 192.168.2.168, vgroup: default_tx_group
10:29:09.391 INFO --- [nPool.commonPool-worker-3] [erver.coordinator.AbstractCore] [ branchReport] [192.168.2.50:8091:7800661551294558907] : Report branch status successfully, xid = 192.168.2.50:8091:7800661551294558907, branchId = 7800661551294558909
10:29:09.393 INFO --- [ batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [ run] [] : receive msg[merged]: BranchReportRequest{xid='192.168.2.50:8091:7800661551294558907', branchId=7800661551294558909, resourceId='null', status=PhaseOne_Failed, applicationData='null', branchType=AT}, clientIp: 192.168.2.168, vgroup: default_tx_group
10:29:09.393 INFO --- [ batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [ run] [] : result msg[merged]: BranchReportResponse{resultCode=Success, msg='null'}, clientIp: 192.168.2.168, vgroup: default_tx_group
10:29:09.398 INFO --- [ batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [ run] [] : receive msg[single]: GlobalRollbackRequest{xid='192.168.2.50:8091:7800661551294558907', extraData='null'}, clientIp: 192.168.2.168, vgroup: default_tx_group
10:29:09.402 INFO --- [rverHandlerThread_1_4_500] [server.coordinator.DefaultCore] [ doGlobalRollback] [192.168.2.50:8091:7800661551294558907] : Rollback global transaction successfully, xid = 192.168.2.50:8091:7800661551294558907.
10:29:09.403 INFO --- [ batchLoggerPrint_1_1] [ocessor.server.BatchLogHandler] [ run] [] : result msg[single]: GlobalRollbackResponse{globalStatus=Rollbacked, resultCode=Success, msg='null'}, clientIp: 192.168.2.168, vgroup: default_tx_group 出现了违反表结构的错误 |
这个是dameng的driver有bug吧,这个时候应该抛出的是SQLIntegrityConstraintViolationException,而不是BatchUpdateException |
@teng-jy 你能联系到dameng的技术人员吗,反馈下这个问题 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
any plan merge to 1.6.1? |
Ⅰ. Describe what this PR did
support DM DataBase
Ⅱ. Does this pull request fix one issue?
fixes #4014
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
download DM,and add table
sql:
Ⅴ. Special notes for reviews
add support DM DataBase